
import java.util.HashMap;
import java.util.Map;


public class MyMap {
	
	public static void main(String[] args) {
		
		Map<Long, Book> books = new HashMap<>();
		
		books.put(1l, new Book("Lords of the Rings"));
		books.put(2l, new Book("Hobbit"));
		books.put(3l, new Book("Silmarilion"));
		
		for (Book book : books.values()) {
			System.out.println(book);
		}
		
		System.out.println(books.get(2l));
		
		books.put(2l, new Book("Przeminelo z wiatrem"));
		
		System.out.println(books.get(2l));
		
		
	}

}
